<%
   @asad = Array.new
   for i in rent[1] do
       @asad << i.flat_id
   end
 %>

<% for object in rent[0] %>
              <tr class="oneroom">
                  <td class="cost">
                    <% if object.price < 2000 %>
                        <%= object.price * 8 %> грн
                    <% else %>
                        <%= object.price %> usd
                    <% end %>
                    <!--<%= object.price %>-->
                  </td>
                  <td class="info">
		              <strong><%= (object.info)[0,4] %></strong>
                      <%= (object.info).to_s[4, (object.info.to_s.length)] %>
                      <% if @asad.index(object.id.to_i) != nil %>
                            <div style="height:20px; width:180px;">
                            <div class="bark_delete" style="">
                                <%= link_to 'Убрать из закладок',
                                      {:action => 'remove_bookmark', :id => object},
                                      {:class => 'remove_bookmark'}%>
                                </div>

                            </div>
                      <% else %>
                      <!--  ADD TO BOOKMARK -->
                      <div style="height:20px; width:180px;">
                          <div class="bark" style="display:none;">


                          <%= link_to 'Добавить в закладки',
                                      {:action => 'add_to_bookmarks', :id => object.id},
                                      {:class => 'add_to_bookmark'}%>
                          </div>

                      </div>

                    <!--  ADD TO BOOKMARK  END-->
                      <% end %>




                  </td>
                  <td class="contacts">
                      <%= object.contacts.to_s[8, (object.contacts.to_s.length)] %>
                      <%= link_to 'туда', {:action => 'show', :id => object}%>
                  </td>
                  <td class="date">
                      <%= object.date.to_s %> | <b><%= object.id.to_s %></b>
                  </td>

              </tr>

<% end %>



<script type="text/javascript">
 $("tr.oneroom").mouseover(function() {
     $(this).toggleClass('highlight');
     $(this).find("div.bark").show();
 })
 $("tr.oneroom").mouseout(function() {
     $(this).removeClass('highlight');
     $(this).find("div.bark").hide();
 })
        

</script>


<!--onMouseOver="this.className='highlight'" onmouseout="this.className='normal'"-->
